
package com.liao.badminton.controller;

import com.liao.badminton.code.*;
import com.liao.badminton.dto.SystemSmsLogDto;
import com.liao.badminton.service.SystemSmsLogService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import com.liao.badminton.code.validation.FindDetail;
import org.springframework.validation.annotation.Validated;
/**
* @author liaocheng
* @date 2024-11-01
* description:短信日志
*/
@RestController
@RequestMapping(value = "/systemSmsLog")
 @PreAuthorize("@ss.hasPermission('systemSmsLog')")//权限管理;
public class SystemSmsLogController {

  //  private static  Logger logger= LoggerFactory.getLogger(SystemSmsLogController.class);

    @Autowired
    private SystemSmsLogService systemSmsLogService;




    /**
    * 新增systemSmsLog
    */
    @RequestMapping(value = "/add")
    @PreAuthorize("@ss.hasPermission('systemSmsLog:add')")//权限管理;
    public ResponseRest<Long> add(@RequestBody @Validated(Insert.class) SystemSmsLogDto systemSmsLog)throws ProjectException{
        return systemSmsLogService.saveSystemSmsLog(systemSmsLog);
    }
    /**
    * 批量删除
    */
    @RequestMapping(value = "/deletes")
    @PreAuthorize("@ss.hasPermission('systemSmsLog:deletes')")//权限管理;
    public ResponseRest<Boolean> deletes(@RequestBody @Validated(Delete.class) SystemSmsLogDto param)throws ProjectException{
        return systemSmsLogService.deletesSystemSmsLog(param);
    }
    /**
    * 修改systemSmsLog
    */
    @RequestMapping(value = "/update")
    @PreAuthorize("@ss.hasPermission('systemSmsLog:update')")//权限管理;
    public ResponseRest<Boolean> update(@RequestBody @Validated(Update.class) SystemSmsLogDto param)throws ProjectException{
        return systemSmsLogService.updateSystemSmsLog(param);
    }

    @RequestMapping(value = "/findDetail")
    @PreAuthorize("@ss.hasPermission('SystemSmsLog:findDetail')")//权限管理;
    public ResponseRest findDetail(@RequestBody @Validated(FindDetail.class) SystemSmsLogDto param) throws ProjectException {
      return systemSmsLogService.findDetail(param);
    }
    /**
    * 分页查询列表
    */
    @RequestMapping(value = "/list")
    @PreAuthorize("@ss.hasPermission('systemSmsLog:list')")//权限管理;
    public ResponseRest list(@RequestBody PageParam<SystemSmsLogDto> body) throws ProjectException{
      return   systemSmsLogService.findSystemSmsLogByPageParam(body);
    }

}
